import request from "@/utils/request";

/**
 * 验收标准模块
 * @returns { StandardData }
 */
export const standardTemplateTree = () => {
  return request({
    url: "/dbo/standardTemplate/list",
    method: "get"
  });
};

/**
 * 获取标准模板详情
 * @param { string } templateId
 * @returns { StandardDataItem }
 */
export const standardTemplateDetail = templateId => {
  return request({
    url: `/dbo/standardTemplate/getCheckStandardTemplateInfo/${templateId}`,
    method: "get"
  });
};

/**
 * 新增验收标准
 * @param { StandardParams } data
 */
export const addStandardTemplate = data => {
  return request({
    url: "/dbo/standardTemplate/add",
    method: "post",
    data
  });
};

/**
 * 修改验收标准
 * @param { StandardDataItem } data
 */
export const updateStandardTemplate = data => {
  return request({
    url: "/dbo/standardTemplate/update",
    method: "post",
    data
  });
};

/**
 * 删除标准模板
 */
export const deleteStandardTemplate = templateId => {
  return request({
    url: `/dbo/standardTemplate/delete/${templateId}`,
    method: "post"
  });
};

/**
 * 排序
 */
export const sortStandardTemplate = data => {
  return request({
    url: "/dbo/standardTemplate/dragSort",
    method: "post",
    data
  });
};
